Index: /issm/trunk-jpl/jenkins/pine_island-mac-solid_earth
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26357)
+++ /issm/trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26358)
@@ -86,4 +86,4 @@
 # - Excluding 2006 until it can be debugged (file I/O)
 #
-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
-PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
+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-jpl/jenkins/ross-debian_linux-solid_earth
===================================================================
--- /issm/trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26357)
+++ /issm/trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26358)
@@ -86,9 +86,6 @@
 #
 # 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)
 #
-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
-PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
+MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2007 2051 2052 2053 2084 2085 2424 2425]"
+PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425"
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26357)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26358)
@@ -30,5 +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
-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,2004,2006,2007,2011,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="/usr/local/MATLAB/R2019b"
 
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26357)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26358)
@@ -30,5 +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
+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
 
 ## Environment
Index: sm/trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh	(revision 26357)
+++ 	(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-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh	(revision 26357)
+++ 	(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-jpl/packagers/linux/test-issm-linux-binaries.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries.sh	(revision 26357)
+++ 	(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-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26357)
+++ /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26358)
@@ -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-jpl/packagers/mac/test-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26357)
+++ /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26358)
@@ -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-jpl/src/m/archive/arch.py
===================================================================
--- /issm/trunk-jpl/src/m/archive/arch.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/archive/arch.py	(revision 26358)
@@ -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-jpl/src/m/boundaryconditions/SetIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26358)
@@ -11,49 +11,49 @@
     """
 
-    #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
 
-    #Initialize surface and basal forcings
+    # Initialize surface and basal forcings
     md.smb.initialize(md)
     md.basalforcings.initialize(md)
 
-    #Initialize ocean forcings and sealevel
+    # Initialize ocean forcings and sealevel
     md.dsl.initialize(md)
 
-    #Deal with other boundary conditions
+    # 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-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26358)
@@ -24,32 +24,32 @@
     #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("Warning: SetMarineIceSheetBC.py: 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-jpl/src/m/classes/SMBcomponents.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26358)
@@ -22,4 +22,16 @@
 			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
 
@@ -66,16 +78,4 @@
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		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 marshall(self,prefix,md,fid) % {{{
 
@@ -92,5 +92,5 @@
 			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
Index: /issm/trunk-jpl/src/m/classes/SMBcomponents.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26358)
@@ -21,4 +21,5 @@
         self.averaging = 0
         self.requested_outputs = []
+        self.isclimatology = np.nan
 
         nargs = len(args)
@@ -30,5 +31,5 @@
 
     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]'))
@@ -44,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
     # }}}
@@ -57,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")
         return self
     # }}}
@@ -79,5 +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.requested_outputs', 'stringrow', 1)
         return md
     # }}}
@@ -87,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']
Index: /issm/trunk-jpl/src/m/classes/SMBforcing.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBforcing.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBforcing.py	(revision 26358)
@@ -19,4 +19,5 @@
         self.requested_outputs = []
         self.averaging = 0
+        self.isclimatology = np.nan
 
         nargs = len(args)
@@ -31,9 +32,9 @@
         s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
         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
     #}}}
@@ -51,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
     #}}}
@@ -71,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')
Index: /issm/trunk-jpl/src/m/classes/SMBgemb.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBgemb.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBgemb.m	(revision 26358)
@@ -122,5 +122,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.
@@ -138,206 +139,4 @@
 					error('constructor not supported: need geometry and mesh to set defaults');
 			end
-		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 (aIdx == 0) & ~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.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.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.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.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);
-					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 % }}}
 		function disp(self) % {{{
@@ -444,4 +243,206 @@
 
 		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 (aIdx == 0) & ~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.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.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.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.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);
+					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 % }}}
 		function marshall(self,prefix,md,fid) % {{{
 
Index: /issm/trunk-jpl/src/m/classes/SMBgemb.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBgemb.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBgemb.py	(revision 26358)
@@ -8,29 +8,30 @@
 
 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
+        self.isalbedo
+        self.isshortwave
+        self.isthermal
+        self.isaccumulation
+        self.ismelt
+        self.isdensification
+        self.isturbulentflux
+        self.isconstrainsurfaceT
+        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 +41,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,6 +48,6 @@
         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, or density exceeds adThresh
+        # 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)
 
@@ -54,5 +56,5 @@
         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)
@@ -63,32 +65,34 @@
         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, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) 
+        # 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, 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. (2018)
-            # 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]
@@ -96,12 +100,12 @@
         self.outputFreq             = np.nan    # output frequency in days (default is monthly, 30)
 
-        #specific albedo parameters:
-        #Method 1
-        dswdiffrf                   = np.nan    #downward diffusive shortwave radiation flux [W/m^2]
-        szaValue                    = np.nan    #Solar Zenith Angle [degree]
-        cotValue                    = np.nan    #Cloud Optical Thickness
-        ccsnowValue                 = np.nan    #concentration of light absorbing carbon for snow [ppm1]
-        cciceValue                  = np.nan    #concentration of light absorbing carbon for ice [ppm1]
-        #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
@@ -116,8 +120,8 @@
         # Default value is rho water (1023 kg m-3).
 
-        #densities:
+        # 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)
 
@@ -126,5 +130,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.
@@ -132,11 +137,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')
         #}}}
 
@@ -145,98 +149,98 @@
         #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, '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, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dlwrf', '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, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
-        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:
-        string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
+        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'))
+        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, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
+
+        # 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)'))
+            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:
-                string = "%s\n%s" % (string, fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
-                string = "%s\n%s" % (string, fielddisplay(self,'cotValue','Cloud Optical Thickness'))
-                string = "%s\n%s" % (string, fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
-                string = "%s\n%s" % (string, fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]'))
-
+                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, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
-        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. (2018)',
-                                                                     '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
     #}}}
 
@@ -245,5 +249,5 @@
         self.V = project3d(md, 'vector', self.V, 'type', 'element')
         self.dswrf = project3d(md, 'vector', self.dswrf, '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')
@@ -270,4 +274,5 @@
         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');
@@ -295,5 +300,4 @@
     def setdefaultparameters(self, mesh, geometry):  # {{{
         self.isgraingrowth = 1
-        self.issmbgradients = 0
         self.isalbedo = 1
         self.isshortwave = 1
@@ -310,5 +314,5 @@
         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
@@ -322,5 +326,5 @@
         self.outputFreq = 30
 
-        #additional albedo parameters
+        # Additional albedo parameters
         self.aSnow = 0.85
         self.aIce = 0.48
@@ -347,9 +351,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,))
     #}}}
@@ -358,5 +366,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])
@@ -398,5 +405,7 @@
         md = checkfield(md, 'fieldname', 'smb.adThresh', 'NaN', 1, 'Inf', 1, '>=', 0)
 
-        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)):
+        if self.aIdx == 0:
+            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+        elif 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)
@@ -406,7 +415,4 @@
                 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 == 0:
-            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
         elif self.aIdx == 3:
             md = checkfield(md, 'fieldname', 'smb.cldFrac', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
@@ -416,5 +422,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):
@@ -432,5 +438,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')
@@ -441,4 +446,5 @@
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isturbulentflux', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', '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)
@@ -498,5 +504,5 @@
         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!')
@@ -517,5 +523,5 @@
             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
+        time = self.Ta[-1]  # Assume all forcings are on the same time step
         dtime = np.diff(time, n=1, axis=0)
         dt = min(dtime)
@@ -525,7 +531,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-jpl/src/m/classes/SMBmeltcomponents.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26358)
@@ -10,7 +10,7 @@
 		melt = NaN;
 		refreeze = NaN;
-		steps_per_step=1;
+		steps_per_step = 1;
 		averaging = 0;
-		requested_outputs      = {};
+		requested_outputs= {};
 		isclimatology;
 	end
@@ -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) % {{{
@@ -72,17 +85,4 @@
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		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 marshall(self,prefix,md,fid) % {{{
 
Index: /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26358)
@@ -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,33 +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.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, '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
     #}}}
 
@@ -52,48 +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.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')
@@ -106,4 +114,3 @@
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-
     # }}}
Index: /issm/trunk-jpl/src/m/classes/basalforcings.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/basalforcings.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/basalforcings.m	(revision 26358)
@@ -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-jpl/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 26358)
@@ -23,7 +23,7 @@
     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
     #}}}
@@ -37,8 +37,8 @@
         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
     #}}}
@@ -62,6 +62,6 @@
         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-jpl/src/m/classes/clusters/generic.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 26358)
@@ -57,5 +57,5 @@
 
     def __repr__(self):  # {{{
-        #  display the object
+        # Display the object
         s = 'class \'{}\' object \'{}\' = \n'.format(type(self), 'self')
         s += '    name: {}\n'.format(self.name)
@@ -183,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')
@@ -192,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:
@@ -219,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-jpl/src/m/classes/constants.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/constants.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/constants.py	(revision 26358)
@@ -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:
@@ -23,28 +22,26 @@
     #}}}
     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]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "gravitational_constant", "Newtonian constant of gravitation [m^3/kg/s^2]"))
-
-        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:
+        # Gravitational constant:
         self.gravitational_constant = 6.67259e-11
 
@@ -52,5 +49,5 @@
     #}}}
     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])
Index: /issm/trunk-jpl/src/m/classes/dsl.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/dsl.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/dsl.m	(revision 26358)
@@ -41,7 +41,7 @@
 
 			%Early return
-			if ~ismember('SealevelchangeAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
-			if (md.transient.isoceantransport==0) return;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);
Index: /issm/trunk-jpl/src/m/classes/dsl.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/dsl.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/dsl.py	(revision 26358)
@@ -41,5 +41,5 @@
     def checkconsistency(self, md, solution, analyses):  #{{{
         # Early return
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (md.transient.isoceantransport == 0):
+        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)
@@ -56,5 +56,5 @@
         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, 'yts', yts)  # mattype 2, because we are sending a GMSL value identical everywhere on each element.
+        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.
@@ -68,4 +68,6 @@
 
     def initialize(self, md):  #{{{
+        print('sdasa')
+        exit()
         if np.isnan(self.global_average_thermosteric_sea_level):
             self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
Index: /issm/trunk-jpl/src/m/classes/dslmme.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/dslmme.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/dslmme.m	(revision 26358)
@@ -35,7 +35,7 @@
 
 			%Early return
-			if ~ismember('SealevelchangeAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
-			if (md.transient.isoceantransport==0) return;end
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
+				return;
+			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);
Index: /issm/trunk-jpl/src/m/classes/dslmme.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/dslmme.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/dslmme.py	(revision 26358)
@@ -13,8 +13,8 @@
 
     def __init__(self, *args):  #{{{
-        self.modelid = 0  # Index into the multi-model ensemble
-        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.
+        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.
 
         nargs = len(args)
@@ -41,5 +41,5 @@
     def checkconsistency(self, md, solution, analyses):  # {{{
         # Early return
-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
             return md
 
@@ -60,7 +60,7 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
         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, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_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_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+        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)
     #}}}
 
Index: /issm/trunk-jpl/src/m/classes/fourierlove.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/fourierlove.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/fourierlove.py	(revision 26358)
@@ -38,4 +38,7 @@
 
     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]'))
@@ -43,7 +46,7 @@
         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: 6378e3) [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 1.0e11) [Pa]'))
+        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])'))
@@ -51,5 +54,5 @@
         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, '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]'))
@@ -121,5 +124,5 @@
             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 == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9):
+        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))
 
Index: /issm/trunk-jpl/src/m/classes/geometry.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/geometry.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/geometry.py	(revision 26358)
@@ -14,5 +14,5 @@
     """
 
-    def __init__(self, *args): #{{{
+    def __init__(self, *args):  # {{{
         self.surface = np.nan
         self.thickness = np.nan
@@ -25,7 +25,7 @@
         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]'))
@@ -34,11 +34,11 @@
         s += '{}\n'.format(fielddisplay(self, 'bed', 'bed elevation [m]'))
         return s
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): #{{{
+    def setdefaultparameters(self):  # {{{
         return
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         if solution == 'LoveSolution':
             return md
@@ -60,10 +60,10 @@
     # }}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    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.numberofvertices + 1, 'yts', md.constants.yts)
+            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')
@@ -75,5 +75,5 @@
     # }}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  # {{{
         self.surface = project3d(md, 'vector', self.surface, 'type', 'node')
         self.thickness = project3d(md, 'vector', self.thickness, 'type', 'node')
@@ -82,3 +82,3 @@
         self.bed = project3d(md, 'vector', self.bed, 'type', 'node')
         return self
-    #}}}
+    # }}}
Index: /issm/trunk-jpl/src/m/classes/groundingline.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/groundingline.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/groundingline.py	(revision 26358)
@@ -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-jpl/src/m/classes/initialization.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/initialization.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/initialization.py	(revision 26358)
@@ -39,8 +39,8 @@
     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]'))
@@ -70,4 +70,6 @@
             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])
@@ -155,4 +157,6 @@
         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
Index: /issm/trunk-jpl/src/m/classes/issmsettings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/issmsettings.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/issmsettings.py	(revision 26358)
@@ -39,20 +39,20 @@
 
     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-jpl/src/m/classes/levelset.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/levelset.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/levelset.m	(revision 26358)
@@ -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      = 1e12; % No need for general cases, unless specified
+			self.migration_max    = 1e12; % No need for general cases, unless specified
 
 			%Linear elements by default
@@ -58,13 +67,4 @@
 			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-jpl/src/m/classes/levelset.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/levelset.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/levelset.py	(revision 26358)
@@ -1,48 +1,42 @@
+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
@@ -50,5 +44,5 @@
         self.migration_max = 1e12 # No need for general cases, unless specified
 
-    #Linear elements by default
+        # Linear elements by default
         self.fe = 'P1'
 
@@ -57,5 +51,5 @@
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
+        # Early return
         if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
             return md
@@ -70,4 +64,9 @@
     # }}}
 
+    def extrude(self, md):  # {{{
+        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
+        return self
+    #}}}
+
     def marshall(self, prefix, md, fid):  # {{{
         yts = md.constants.yts
@@ -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-jpl/src/m/classes/lovenumbers.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/lovenumbers.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/lovenumbers.py	(revision 26358)
@@ -81,4 +81,5 @@
         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)
Index: /issm/trunk-jpl/src/m/classes/matdamageice.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matdamageice.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matdamageice.m	(revision 26358)
@@ -95,6 +95,6 @@
 			self.rheology_law='Paterson';
 
-			%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 % }}}
Index: /issm/trunk-jpl/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matdamageice.py	(revision 26358)
@@ -6,6 +6,5 @@
 
 class matdamageice(object):
-    """
-    MATICE class definition
+    """MATICE class definition
 
        Usage:
@@ -14,23 +13,23 @@
 
     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 = ''
 
         #SLC
-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+        self.earth_density = 0
 
         self.setdefaultparameters()
@@ -38,26 +37,22 @@
 
     def __repr__(self):  # {{{
-        # TODO:
-        # - Convert all formatting to calls to <string>.format (see any 
-        #   already converted <class>.__repr__ method for examples)
-        #
-        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, "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
     #}}}
@@ -70,36 +65,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'
 
-        #SLC
-        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
     #}}}
Index: /issm/trunk-jpl/src/m/classes/matenhancedice.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matenhancedice.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matenhancedice.m	(revision 26358)
@@ -64,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)
@@ -80,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;
@@ -97,5 +97,5 @@
 			self.rheology_law='Paterson';
 
-			%SLR
+			%SLC
 			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
 
Index: /issm/trunk-jpl/src/m/classes/matenhancedice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matenhancedice.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matenhancedice.py	(revision 26358)
@@ -1,2 +1,4 @@
+import numpy as np
+
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -12,108 +14,98 @@
     """
 
-    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 = ''
 
         #SLC
-        self.earth_density = 0  # average density of the Earth, (kg/m^3)
+        self.earth_density = 0
 
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
-        # TODO:
-        # - Convert all formatting to calls to <string>.format (see any 
-        #   already converted <class>.__repr__ method for examples)
-        #
-        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, "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)
-
-        #SLC
-        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)
@@ -131,5 +123,5 @@
     # }}}
 
-    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')
Index: /issm/trunk-jpl/src/m/classes/materials.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/materials.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/materials.m	(revision 26358)
@@ -175,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]');
@@ -192,5 +192,5 @@
 					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:'));
+					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]');
@@ -211,5 +211,5 @@
 					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]');
Index: /issm/trunk-jpl/src/m/classes/materials.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/materials.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/materials.py	(revision 26358)
@@ -76,5 +76,5 @@
             nat = self.nature[i]
             if nat == 'ice':
-                s += 'Ice:\n'
+                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]'))
@@ -93,5 +93,5 @@
                 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 += 'Litho:\n'
+                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]'))
@@ -111,5 +111,5 @@
                 s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default: 1) (numlayers)'))
             elif nat == 'hydro':
-                s += 'Hydro:\n'
+                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]'))
@@ -127,11 +127,11 @@
             if nat == 'ice':
                 # Ice density (kg/m^3)
-                self.rho_ice = 917
+                self.rho_ice = 917.0
 
                 # Ocean water density (kg/m^3)
-                self.rho_water = 1023
+                self.rho_water = 1023.0
 
                 # Fresh water density (kg/m^3)
-                self.rho_freshwater = 1000
+                self.rho_freshwater = 1000.0
 
                 # Water viscosity (N.s/m^2)
@@ -139,5 +139,5 @@
 
                 # Ice heat capacity cp (J/kg/K)
-                self.heatcapacity = 2093
+                self.heatcapacity = 2093.0
 
                 # Ice latent heat of fusion L (J/kg)
@@ -160,5 +160,5 @@
 
                 # Mixed layer (ice-water interface) heat capacity (J/kg/K)
-                self.mixed_layer_capacity = 3974
+                self.mixed_layer_capacity = 3974.0
 
                 # Thermal exchange velocity (ice-water interface) (m/s)
@@ -193,15 +193,15 @@
                 self.ebm_tauh = [np.nan, np.nan]
                 self.rheologymodel = [0, 0]
-                self.density = [5.51e3, 5.50e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
+                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
+                self.rho_ice = 917.0
 
                 # Ocean water density (kg/m^3)
-                self.rho_water = 1023
+                self.rho_water = 1023.0
 
                 # Fresh water density (kg/m^3)
-                self.rho_freshwater = 1000
+                self.rho_freshwater = 1000.0
             else:
                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
Index: /issm/trunk-jpl/src/m/classes/matestar.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matestar.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matestar.m	(revision 26358)
@@ -24,5 +24,5 @@
 		rheology_law                    = '';
 
-		%slc
+		%SLC
 		earth_density                   = 0;
 
@@ -87,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;
@@ -104,6 +104,6 @@
 			self.rheology_law='Paterson';
 
-			%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 % }}}
@@ -118,5 +118,5 @@
 			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('SealevelchangeAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
Index: /issm/trunk-jpl/src/m/classes/matestar.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matestar.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matestar.py	(revision 26358)
@@ -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,36 +33,36 @@
         self.rheology_law = ''
 
-        #slc
+        # 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, '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')
@@ -71,43 +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'
-        #slc
-        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)
@@ -126,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')
Index: /issm/trunk-jpl/src/m/classes/matice.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.js	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matice.js	(revision 26358)
@@ -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-jpl/src/m/classes/matice.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matice.m	(revision 26358)
@@ -75,5 +75,5 @@
 			%wet ice thermal conductivity (W/m/K)
 			self.temperateiceconductivity=.24;
-			
+
 			%computation of effective conductivity
 			self.effectiveconductivity_averaging=1;
Index: /issm/trunk-jpl/src/m/classes/matice.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/matice.py	(revision 26358)
@@ -14,85 +14,85 @@
     """
 
-    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 = ''
 
-        #slc
+        # SLC
         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, "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'
 
@@ -103,7 +103,7 @@
         # SLR
         self.earth_density = 5512  # average density of the Earth, (kg/m^3)
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         if solution == 'TransientSolution' and md.transient.isslc:
             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
@@ -116,10 +116,10 @@
             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])
+            md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
 
         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')
@@ -136,7 +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 ((len(np.shape(self.rheology_B)) == 1 and (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', 'earth_density', 'format', 'Double')
-    #}}}
+    # }}}
Index: /issm/trunk-jpl/src/m/classes/model.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/model.m	(revision 26358)
@@ -235,5 +235,5 @@
 			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) ']'],'parHwoameters for transient 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'));
Index: /issm/trunk-jpl/src/m/classes/plumebasalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 26358)
@@ -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-jpl/src/m/classes/rotational.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/rotational.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/rotational.m	(revision 26358)
@@ -21,10 +21,10 @@
 		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] 
+			%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] 
+			% mean rotational velocity of earth
+			self.angularvelocity=7.2921*10^-5; % [s^-1]
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
Index: /issm/trunk-jpl/src/m/classes/rotational.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/rotational.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/rotational.py	(revision 26358)
@@ -33,9 +33,9 @@
     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
     #}}}
Index: /issm/trunk-jpl/src/m/classes/sealevelmodel.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26358)
@@ -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);
 
@@ -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,5 +47,5 @@
 		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,
@@ -58,5 +58,5 @@
 			end
 
-			%check that the transition vectors have the right size: 
+			%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}),
@@ -65,5 +65,5 @@
 			end
 			
-			%check that runfrequency is the same everywhere: 
+			%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,
@@ -72,7 +72,7 @@
 			end
 
-			%make sure steric_rate is the same everywhere: 
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i}; 
+			%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));
@@ -82,5 +82,5 @@
 			%make sure grd is the same everywhere:
 			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i}; 
+				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));
@@ -88,7 +88,7 @@
 			end
 
-			%make sure that there is no solid earth external forcing on the basins: 
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i}; 
+			%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');
@@ -96,7 +96,7 @@
 
 			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}; 
+			%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));
@@ -135,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);
@@ -142,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;
@@ -195,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={};
@@ -209,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;
@@ -222,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={};
@@ -238,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;
@@ -265,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');
@@ -273,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;
@@ -287,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;
@@ -302,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),
@@ -323,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),
@@ -374,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);
@@ -386,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);
@@ -405,5 +405,5 @@
 			end %}}}
 	
-			%Plug into earth: 
+			%Plug into earth:
 			self.earth=md;
 
@@ -414,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);
@@ -421,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);
@@ -437,5 +437,5 @@
 			end %}}}
 
-			%Plug into earth: 
+			%Plug into earth:
 			self.earth=md;
 
@@ -463,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,
@@ -471,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),
@@ -482,5 +482,5 @@
 					end
 				end
-				eval(['capfield1= self.icecaps{1}.' string ';']); 
+				eval(['capfield1= self.icecaps{1}.' string ';']);
 				times=capfield1(end,:);
 				nsteps=length(times);
@@ -514,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
@@ -522,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-jpl/src/m/classes/sealevelmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26358)
@@ -35,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
@@ -61,5 +61,5 @@
             # Set planet type
             self.planet = options.getfieldvalue('planet', 'earth')
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
@@ -71,5 +71,5 @@
 
         return s
-    #}}}
+    # }}}
 
     def setdefaultparameters(self):  # {{{
@@ -83,5 +83,5 @@
         self.eltransitions = []
         self.planet = 'earth'
-    #}}}
+    # }}}
 
     @staticmethod
@@ -102,5 +102,5 @@
         # 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:
+            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))
 
@@ -108,5 +108,5 @@
         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]]) != []:
+            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))
 
@@ -116,4 +116,5 @@
             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)):
@@ -126,5 +127,5 @@
             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):  # {{{
@@ -156,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):  # {{{
@@ -172,5 +173,5 @@
             list.append = self.basins[i].continent
         return np.unique(list)
-    #}}}
+    # }}}
 
     def basinsfromcontinent(self, continent):  # {{{
@@ -180,5 +181,5 @@
                 list.append = self.basins[i].name
         return np.unique(list)
-    #}}}
+    # }}}
 
     def addbasin(self, bas):  # {{{
@@ -186,5 +187,5 @@
             raise Exception('addbasin method only takes a \'basin\' class object as input')
         self.basins.append(bas)
-    #}}}
+    # }}}
 
     def intersections2d(self, *args): #{{{
@@ -211,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)
@@ -239,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')
@@ -280,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 #{{{
@@ -325,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)
@@ -372,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)
@@ -398,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]
@@ -407,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]
@@ -419,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]
@@ -442,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)):
@@ -453,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
@@ -461,7 +462,7 @@
         else:
             raise Exception('not supported yet')
-    #}}}
-
-    def homogenize(self, noearth=0):  #{{{
+    # }}}
+
+    def homogenize(self, noearth=0):  # {{{
         mintimestep = np.inf
 
@@ -486,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-jpl/src/m/classes/solidearth.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearth.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearth.m	(revision 26358)
@@ -69,18 +69,18 @@
 			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 default: 
+			%no external solutions by default:
 			self.external=[];
 
 			%planet radius
 			self.planetradius= planetradius(planet);
-		
+
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -116,4 +116,5 @@
 				npartice=0;
 			end
+
 			if ~isempty(self.partitionhydro),
 				nparthydro=max(self.partitionhydro)+2;
Index: /issm/trunk-jpl/src/m/classes/solidearth.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearth.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearth.py	(revision 26358)
@@ -4,4 +4,5 @@
 from fielddisplay import fielddisplay
 from lovenumbers import lovenumbers
+from MatlabFuncs import *
 from planetradius import planetradius
 from project3d import project3d
@@ -9,6 +10,4 @@
 from solidearthsettings import solidearthsettings
 from solidearthsolution import solidearthsolution
-from offlinesolidearthsolution import offlinesolidearthsolution
-from surfaceload import surfaceload
 from WriteData import WriteData
 
@@ -25,7 +24,7 @@
     """
 
-    def __init__(self, *args): #{{{
+    def __init__(self, *args):  # {{{
         self.settings           = solidearthsettings()
-        self.external           = []
+        self.external           = None
         self.lovenumbers        = lovenumbers()
         self.rotational         = rotational()
@@ -44,6 +43,6 @@
         else:
             raise Exception('solidearth constructor error message: zero or one argument only!')
-    #}}}
-    def __repr__(self): #{{{
+    # }}}
+    def __repr__(self):  # {{{
         s = '   solidearthinputs, forcings and settings:\n'
         s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]'))
@@ -58,9 +57,9 @@
         print(self.lovenumbers)
         print(self.rotational)
-        if self.external:
+        if len(self.external):
             print(self.external)
         return s
-    #}}}
-    def setdefaultparameters(self, planet): #{{{
+    # }}}
+    def setdefaultparameters(self, planet):  # {{{
         # Output default
         self.requested_outputs = ['default']
@@ -75,10 +74,10 @@
 
         # No external solutions by default
-        self.external = []
+        self.external = None
 
         # Planet radius
         self.planetradius = planetradius(planet)
-    #}}}
-    def checkconsistency(self, md, solution, analyses): #{{{
+    # }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
         if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return md
@@ -90,13 +89,13 @@
         self.rotational.checkconsistency(md, solution, analyses)
         if self.external:
-            if (not isinstance(self.external,solidearthsolution)) and (not isinstance(self.external,offlinesolidearthsolution)):
+            if not isa(self.external, solidearthsolution):
                 raise Exception('solidearth consistency check: external field should be a solidearthsolution')
             self.external.checkconsistency(md, solution, analyses)
         return md
-    #}}}
-    def defaultoutputs(self, md): #{{{
+    # }}}
+    def defaultoutputs(self, md):  # {{{
         return ['Sealevel']
-    #}}}
-    def marshall(self, prefix, md, fid): #{{{
+    # }}}
+    def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
@@ -133,13 +132,13 @@
             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.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): #{{{
+    # }}}
+    def extrude(self, md):  # {{{
         return self
-    #}}}
+    # }}}
Index: /issm/trunk-jpl/src/m/classes/solidearthsettings.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26358)
@@ -56,38 +56,38 @@
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-		
-		%Convergence criterion: absolute, relative and residual
-		self.reltol=0.01; % 1 percent
-		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.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;
+			%maximum of non-linear iterations.
+			self.maxiter=5;
 
-		%numerical discretization accuracy
-		self.degacc=.01;
-		self.timeacc=1; 
+			%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;
+			%numerical discretization accuracy
+			self.degacc=.01;
+			self.timeacc=1; 
 
-		%horizontal displacement? (not on by default)
-		self.horiz=0;
+			%how many time steps we skip before we run solidearthsettings solver during transient
+			self.runfrequency=1;
 
-		%cross section for Ivins model
-		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+			%horizontal displacement? (not on by default)
+			self.horiz=0;
 
-		%no grd model by default: 
-		self.grdmodel=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 % }}}
@@ -179,5 +179,5 @@
 		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);
Index: /issm/trunk-jpl/src/m/classes/solidearthsettings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26358)
@@ -13,5 +13,5 @@
     """
 
-    def __init__(self, *args): #{{{
+    def __init__(self, *args):  # {{{
         self.reltol                 = 0
         self.abstol                 = 0
@@ -37,7 +37,7 @@
         else:
             raise Exception('constructor not supported')
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
+    def __repr__(self):  # {{{
         s = '   solidearth settings:\n'
         s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level change relative convergence criterion (default, NaN: not applied)'))
@@ -59,7 +59,7 @@
         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
@@ -81,5 +81,5 @@
 
         # Numerical discretization accuracy
-        self.degacc = .01
+        self.degacc = 0.01
         self.timeacc = 1
 
@@ -95,7 +95,7 @@
         # No GRD model by default
         self.grdmodel = 0
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return md
@@ -131,7 +131,7 @@
 
         return md
-    #}}}
+    # }}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    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');
@@ -145,5 +145,5 @@
         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', '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');
@@ -152,7 +152,7 @@
         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-jpl/src/m/classes/solidearthsolution.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26358)
@@ -20,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) % {{{
 	
@@ -34,12 +42,4 @@
 			md = checkfield(md,'fieldname','solidearth.external.displacementup','Inf',1,'timeseries',1);
 			md = checkfield(md,'fieldname','solidearth.external.geoid','Inf',1,'timeseries',1);
-
-		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 % }}}
Index: /issm/trunk-jpl/src/m/classes/solidearthsolution.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26358)
@@ -13,9 +13,9 @@
     """
 
-    def __init__(self, *args): #{{{
-        self.displacementeast = None
-        self.displacementnorth = None
-        self.displacementup = None
-        self.geoid = None
+    def __init__(self, *args):  # {{{
+        self.displacementeast = []
+        self.displacementnorth = []
+        self.displacementup = []
+        self.geoid = []
 
         if len(args) == 0:
@@ -23,7 +23,7 @@
         else:
             raise RuntimeError('constructor not supported')
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
+    def __repr__(self):  # {{{
         s = '         units for time series is (yr)\n'
         s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
@@ -33,25 +33,28 @@
 
         return s
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): #{{{
+    def setdefaultparameters(self):  # {{{
         self.displacementeast = []
         self.displacementnorth = []
         self.displacementup = []
         self.geoid = []
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    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): #{{{
+    def marshall(self, prefix, md, fid):  # {{{
         yts = md.constants.yts
 
+        print('sadjsda')
+        exit()
+
         # Transform our time series into time series rates
-        if len(np.shape(self.displacementeast)) == 1:
+        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)
@@ -76,7 +79,7 @@
         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): #{{{
+    def extrude(self, md):  # {{{
         return self
-    #}}}
+    # }}}
Index: /issm/trunk-jpl/src/m/classes/stressbalance.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/stressbalance.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/stressbalance.m	(revision 26358)
@@ -53,28 +53,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 % }}}
Index: /issm/trunk-jpl/src/m/classes/stressbalance.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/stressbalance.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/stressbalance.py	(revision 26358)
@@ -18,7 +18,7 @@
 
     def __init__(self):  # {{{
-        self.spcvx = float('NaN')
-        self.spcvy = float('NaN')
-        self.spcvz = float('NaN')
+        self.spcvx = np.nan
+        self.spcvy = np.nan
+        self.spcvz = np.nan
         self.restol = 0
         self.reltol = 0
@@ -26,19 +26,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 +48,16 @@
         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 += '      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 +65,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):  # {{{
@@ -77,27 +78,33 @@
 
         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 +114,5 @@
             list = ['Vx', 'Vy', 'Vel', 'Pressure']
         return list
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
@@ -131,13 +138,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)))):
             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,5 +156,5 @@
                 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))
Index: /issm/trunk-jpl/src/m/classes/surfaceload.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/surfaceload.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/surfaceload.m	(revision 26358)
@@ -65,10 +65,10 @@
 		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;
 
Index: /issm/trunk-jpl/src/m/classes/surfaceload.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/surfaceload.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/surfaceload.py	(revision 26358)
@@ -51,13 +51,28 @@
 
     def marshall(self, prefix, md, fid):  #{{{
-        if np.isnan(self.icethicknesschange).all():
-            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1))
-        if np.isnan(self.waterheightchange).all():
-            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1))
-        if np.isnan(self.other).all():
-            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)
+        # 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, ))
+
+        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, ))
+
+        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)
     #}}}
 
Index: /issm/trunk-jpl/src/m/classes/transient.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/transient.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/transient.m	(revision 26358)
@@ -34,18 +34,18 @@
 
 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-			self.issmb           = 0;
-			self.ismasstransport = 0;
-			self.isoceantransport= 0;
-			self.isstressbalance = 0;
-			self.isthermal       = 0;
-			self.isgroundingline = 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.issampling      = 0;
-			self.isslc           = 0;
-			self.isoceancoupling = 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.isoceantransport = 0;
-			self.isstressbalance = 1;
-			self.isthermal       = 1;
-			self.isgroundingline = 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.issampling      = 0;
-			self.isslc           = 0;
-			self.isoceancoupling = 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
Index: /issm/trunk-jpl/src/m/classes/transient.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/transient.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/transient.py	(revision 26358)
@@ -29,5 +29,5 @@
 
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
@@ -49,5 +49,5 @@
         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
         return s
-    #}}}
+    # }}}
 
     def defaultoutputs(self, md):  # {{{
@@ -56,5 +56,5 @@
         else:
             return []
-    #}}}
+    # }}}
 
     def deactivateall(self):  #{{{
@@ -77,8 +77,9 @@
         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
@@ -99,5 +100,5 @@
         self.requested_outputs = ['default']
         return self
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
Index: /issm/trunk-jpl/src/m/classes/verbose.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/verbose.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/classes/verbose.py	(revision 26358)
@@ -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-jpl/src/m/consistency/ismodelselfconsistent.py
===================================================================
--- /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26358)
@@ -6,5 +6,5 @@
     """
 
-    #initialize consistency as true
+    # Initialize consistency as true
     md.private.isconsistent = True
 
@@ -12,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':
@@ -86,3 +85,3 @@
 
     return analyses
-#}}}
+# }}}
Index: /issm/trunk-jpl/src/m/coordsystems/ll2xy.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26358)
@@ -3,18 +3,17 @@
 
 def ll2xy(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71):
-    '''
-    LL2XY - converts lat lon to polar stereographic
+    """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'
@@ -33,7 +32,7 @@
     #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)
Index: /issm/trunk-jpl/src/m/coordsystems/xy2ll.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 26358)
@@ -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-jpl/src/m/materials/cuffey.py
===================================================================
--- /issm/trunk-jpl/src/m/materials/cuffey.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/materials/cuffey.py	(revision 26358)
@@ -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-jpl/src/m/materials/paterson.py
===================================================================
--- /issm/trunk-jpl/src/m/materials/paterson.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/materials/paterson.py	(revision 26358)
@@ -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-jpl/src/m/mech/mechanicalproperties.m
===================================================================
--- /issm/trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 26358)
@@ -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-jpl/src/m/mech/mechanicalproperties.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 26358)
@@ -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-jpl/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/mesh/bamg.py	(revision 26358)
@@ -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-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26358)
@@ -197,5 +197,4 @@
 	mesh.z=radius*sind(mesh.lat);
 
-
 	%erase files:
 	system('rm -rf sphere.geo sphere.msh sphere.pos');
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26358)
@@ -82,23 +82,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()
@@ -112,12 +112,12 @@
         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)), 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.close()
         #}}}
@@ -182,8 +182,21 @@
     #}}}
 
-    #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
+    # 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
Index: /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26358)
@@ -1,4 +1,3 @@
-"""
-A collection of functions that replicate the behavior of MATLAB built-in
+"""A collection of functions that replicate the behavior of MATLAB built-in
 functions of the same, respective name.
 
@@ -8,6 +7,6 @@
 """
 
-def acosd(X):  #{{{
-    """ function acosd - Inverse cosine in degrees
+def acosd(X):  # {{{
+    """function acosd - Inverse cosine in degrees
 
     Usage:
@@ -17,8 +16,8 @@
 
     return np.degrees(np.arccos(X))
-#}}}
-
-def asind(X):  #{{{
-    """ function asind - Inverse sine in degrees
+# }}}
+
+def asind(X):  # {{{
+    """function asind - Inverse sine in degrees
 
     Usage:
@@ -28,8 +27,8 @@
 
     return np.degrees(np.arcsin(X))
-#}}}
-
-def atand(X):  #{{{
-    """ function atand - Inverse tangent in degrees
+# }}}
+
+def atand(X):  # {{{
+    """function atand - Inverse tangent in degrees
 
     Usage:
@@ -39,8 +38,8 @@
 
     return np.degrees(np.arctan(X))
-#}}}
-
-
-def atan2d(Y, X):  #{{{
+# }}}
+
+
+def atan2d(Y, X):  # {{{
     """function atan2d - Four-quadrant inverse tangent in degrees
 
@@ -51,7 +50,46 @@
 
     return np.degrees(np.arctan2(Y, X))
-#}}}
-
-def det(a):  #{{{
+# }}}
+
+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]
@@ -61,16 +99,16 @@
         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 error(msg):  #{{{
+        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):  #{{{
+# }}}
+
+def etime(t2, t1):  # {{{
     return t2 - t1
-#}}}
-
-def find(*args):  #{{{
+# }}}
+
+def find(*args):  # {{{
     nargs = len(args)
     if nargs >= 1 or nargs <= 2:
@@ -86,13 +124,13 @@
     else:
         raise Exception('find: must have 1 or 2 arguments')
-#}}}
-
-def floor(X):  #{{{
+# }}}
+
+def floor(X):  # {{{
     import math
 
     return int(math.floor(X))
-#}}}
-
-def heaviside(x):  #{{{
+# }}}
+
+def heaviside(x):  # {{{
     import numpy as np
 
@@ -102,7 +140,7 @@
 
     return y
-#}}}
-
-def isa(A, dataType):  #{{{
+# }}}
+
+def isa(A, dataType):  # {{{
     """FUNCTION ISA
 
@@ -112,13 +150,19 @@
     """
     return type(A) == dataType
-#}}}
-
-def isfile(fileName):  #{{{
+# }}}
+
+# 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():  #{{{
+# }}}
+
+def ismac():  # {{{
     import platform
 
@@ -127,7 +171,7 @@
     else:
         return False
-#}}}
-
-def ismember(a, s):  #{{{
+# }}}
+
+def ismember(a, s):  # {{{
     import numpy as np
 
@@ -149,13 +193,13 @@
 
     return b
-#}}}
-
-def isnan(A):  #{{{
+# }}}
+
+def isnan(A):  # {{{
     import numpy as np
 
     return np.isnan(A)
-#}}}
-
-def ispc():  #{{{
+# }}}
+
+def ispc():  # {{{
     import platform
 
@@ -164,37 +208,76 @@
     else:
         return False
-#}}}
-
-def isprop(obj, PropertyName):  #{{{
+# }}}
+
+def isprop(obj, PropertyName):  # {{{
     return hasattr(obj, PropertyName)
-#}}}
-
-def mod(a, m):  #{{{
+# }}}
+
+def mod(a, m):  # {{{
     return a % m
-#}}}
-
-def pause(n):  #{{{
+# }}}
+
+def pause(n):  # {{{
     import time
 
     time.sleep(n)
-#}}}
-
-def pwd():  #{{{
+# }}}
+
+def pwd():  # {{{
     import os
 
     return os.getcwd()
-#}}}
-
-def oshostname():  #{{{
+# }}}
+
+def oshostname():  # {{{
     import socket
 
     return socket.gethostname()
-#}}}
-
-def rem(a, b):  #{{{
+# }}}
+
+def rem(a, b):  # {{{
     return a % b
-#}}}
-
-def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):  #{{{
+# }}}
+
+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
 
@@ -210,21 +293,21 @@
 
     return a
-#}}}
-
-def strcmp(s1, s2):  #{{{
+# }}}
+
+def strcmp(s1, s2):  # {{{
     if s1 == s2:
         return True
     else:
         return False
-#}}}
-
-def strcmpi(s1, s2):  #{{{
+# }}}
+
+def strcmpi(s1, s2):  # {{{
     if s1.lower() == s2.lower():
         return True
     else:
         return False
-#}}}
-
-def strjoin(*args):  #{{{
+# }}}
+
+def strjoin(*args):  # {{{
     nargs = len(args)
     if nargs >= 1 or nargs <= 2:
@@ -235,17 +318,17 @@
     else:
         raise Exception('strjoin: must have 1 or 2 arguments')
-#}}}
-
-def strncmp(s1, s2, n):  #{{{
+# }}}
+
+def strncmp(s1, s2, n):  # {{{
     if s1[0:n] == s2[0:n]:
         return True
     else:
         return False
-#}}}
-
-def strncmpi(s1, s2, n):  #{{{
+# }}}
+
+def strncmpi(s1, s2, n):  # {{{
     if s1.lower()[0:n] == s2.lower()[0:n]:
         return True
     else:
         return False
-#}}}
+# }}}
Index: /issm/trunk-jpl/src/m/miscellaneous/pretty_print.m
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/pretty_print.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/miscellaneous/pretty_print.m	(revision 26358)
@@ -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-jpl/src/m/plot/checkplotoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 26358)
@@ -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-jpl/src/m/solve/loadresultfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultfromdisk.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/loadresultfromdisk.py	(revision 26358)
@@ -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-jpl/src/m/solve/loadresultsfromcluster.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26358)
@@ -1,3 +1,5 @@
 import os
+import subprocess
+
 from helpers import *
 from loadresultsfromdisk import loadresultsfromdisk
Index: /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 26358)
@@ -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-jpl/src/m/solve/marshall.m
===================================================================
--- /issm/trunk-jpl/src/m/solve/marshall.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/marshall.m	(revision 26358)
@@ -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/BinRead.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-jpl/src/m/solve/marshall.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/marshall.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/marshall.py	(revision 26358)
@@ -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/BinRead.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-jpl/src/m/solve/parseresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26358)
@@ -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':
@@ -193,21 +193,21 @@
             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
Index: /issm/trunk-jpl/src/m/solve/solve.m
===================================================================
--- /issm/trunk-jpl/src/m/solve/solve.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/solve.m	(revision 26358)
@@ -47,5 +47,5 @@
 elseif strcmpi(solutionstring,'mt') || strcmpi(solutionstring,'Masstransport')
 	solutionstring = 'MasstransportSolution';
-elseif strcmpi(solutionstring,'oceanmt') || strcmpi(solutionstring,'Oceantransport')
+elseif strcmpi(solutionstring,'oceant') || strcmpi(solutionstring,'Oceantransport')
 	solutionstring = 'OceantransportSolution';
 elseif strcmpi(solutionstring,'th') || strcmpi(solutionstring,'Thermal')
Index: /issm/trunk-jpl/src/m/solve/solve.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/solve.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/solve.py	(revision 26358)
@@ -84,5 +84,5 @@
         solutionstring = 'SamplingSolution'
     else:
-        raise ValueError("solutionstring '%s' not supported!" % solutionstring)
+        raise ValueError('solutionstring {} not supported!'.format(solutionstring))
     options = pairoptions('solutionstring', solutionstring, *args)
 
@@ -101,8 +101,9 @@
         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 not isempty(restart):
@@ -130,21 +131,28 @@
     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)
 
     # Launch job
     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
Index: /issm/trunk-jpl/src/m/solve/solveslm.m
===================================================================
--- /issm/trunk-jpl/src/m/solve/solveslm.m	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/solveslm.m	(revision 26358)
@@ -3,5 +3,5 @@
 %
 %   Usage:
-%      slm=solve(slm,solutionstring,varargin)
+%      slm=solveslm(slm,solutionstring,varargin)
 %      where varargin is a lit of paired arguments of string OR enums
 %
@@ -9,8 +9,8 @@
 %      - 'Transient'
 %
-%  extra options:
+%   extra options:
 %
 %   Examples:
-%      slm=solve(slm,'Transient');
+%      slm=solveslm(slm,'Transient');
 
 %recover and process solve options
Index: /issm/trunk-jpl/src/m/solve/solveslm.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/solveslm.py	(revision 26357)
+++ /issm/trunk-jpl/src/m/solve/solveslm.py	(revision 26358)
@@ -13,5 +13,5 @@
 
     Usage:
-        slm=solve(slm,solutionstring,varargin)
+        slm=solveslm(slm,solutionstring,varargin)
         where varargin is a lit of paired arguments of string OR enums
 
@@ -22,6 +22,9 @@
 
     Examples:
-        slm=solve(slm,'Transient');
+        slm=solveslm(slm,'Transient');
     """
+
+    print('Yep')
+    exit()
 
     # Recover and process solve options
Index: /issm/trunk-jpl/test/NightlyRun/test2001.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2001.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2001.py	(revision 26358)
@@ -1,9 +1,8 @@
 #Test Name: SquareSheetConstrainedGia2d
 #GIA test, based off of test101. Running default GIA Ivins class.
-from socket import gethostname
-
 import numpy as np
 
 from materials import *
+from MatlabFuncs import *
 from model import *
 from parameterize import *
@@ -29,5 +28,5 @@
 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.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
@@ -57,6 +56,5 @@
 
 #Solve for GIA deflection
-md.cluster = generic('name', gethostname(), 'np', 3)
-md.verbose = verbose('11111111111')
+md.cluster = generic('name', oshostname(), 'np', 3)
 md.verbose.solver = 0
 md = solve(md, 'Transient')
Index: /issm/trunk-jpl/test/NightlyRun/test2002.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2002.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2002.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 100: 
@@ -25,10 +24,10 @@
 longe=atan2d(ye,xe);
 pos=find(late < -80);
-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+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;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
 posgre=pos;
 
Index: /issm/trunk-jpl/test/NightlyRun/test2002.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2002.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2002.py	(revision 26358)
@@ -1,6 +1,4 @@
 #Test Name: EarthSlc
 import numpy as np
-
-from MatlabFuncs import *
 
 from gmshplanet import *
@@ -9,14 +7,8 @@
 from materials import *
 from model import *
-from parameterize import *
 from paterson import *
 from solve import *
 
 
-# Mesh earth
-#
-# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
-# mesh generated under Linux versus under macOS
-#
 md = model()
 md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
@@ -41,10 +33,10 @@
 longe = atan2d(ye, xe)
 pos = np.where(late < -80)[0]
-md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[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 > 60, late < 90, longe > -75, longe < -15)))[0]
-md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
 posgre = pos
 
@@ -60,6 +52,9 @@
 
 icemask = np.ones((md.mesh.numberofvertices, ))
-icemask[md.mesh.elements[posant]] = -1
-icemask[md.mesh.elements[posgre]] = -1
+# 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
Index: /issm/trunk-jpl/test/NightlyRun/test2003.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2003.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2003.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 1000: 
@@ -24,4 +23,5 @@
 late=asind(ze./re);
 longe=atan2d(ye,xe);
+
 %greenland
 pos=find(late>60 & late<90 & longe>-75 & longe<-15);
@@ -31,5 +31,4 @@
 %elastic loading from love numbers:
 md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
-
 %}}}
 %mask:  {{{
@@ -70,10 +69,10 @@
 
 %Physics: 
-md.transient.issmb=0; 
+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;
Index: /issm/trunk-jpl/test/NightlyRun/test2003.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2003.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2003.py	(revision 26358)
@@ -1,10 +1,9 @@
 #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,16 +11,11 @@
 
 
-# Mesh earth
-#
-# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
-# mesh generated under Linux versus under macOS
-#
 md = model()
 md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
 
 # Geometry for the bed, arbitrary thickness of 100
-md.geometry.bed = -1 * np.ones(md.mesh.numberofvertices)
+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.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
 md.geometry.surface = md.geometry.bed + md.geometry.thickness
 
@@ -38,7 +32,8 @@
 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]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 1000
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 1000
 posice = pos
 
@@ -50,5 +45,5 @@
 mask = gmtmask(md.mesh.lat, md.mesh.long)
 icemask = np.ones(md.mesh.numberofvertices)
-icemask[md.mesh.elements[posice]] = -1
+icemask[md.mesh.elements[posice, :] - 1] = -1
 md.mask.ice_levelset = icemask
 oceanmask = -1 * np.ones(md.mesh.numberofvertices)
@@ -100,5 +95,5 @@
 md.solidearth.settings.rotation = 0
 md.solidearth.settings.viscous = 0
-md.cluster = generic('name', gethostname(), 'np', 3)
+md.cluster = generic('name', oshostname(), 'np', 3)
 #md.verbose = verbose('111111111')
 md = solve(md, 'Transient')
@@ -113,5 +108,5 @@
 md.solidearth.settings.rotation = 1
 md.solidearth.settings.viscous = 0
-md.cluster = generic('name', gethostname(), 'np', 3)
+md.cluster = generic('name', oshostname(), 'np', 3)
 #md.verbose = verbose('111111111')
 md = solve(md, 'Transient')
Index: /issm/trunk-jpl/test/NightlyRun/test2004.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2004.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2004.m	(revision 26358)
@@ -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}; 
@@ -269,6 +269,4 @@
 		latGIS=delH(:,2);
 		delHGIS=delH(:,3);
-		% points=[longGIS,latGIS];
-		% index=delaunayn(points);
 		index=BamgTriangulate(longGIS, latGIS);
 		lat=md.mesh.lat;
@@ -277,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');
@@ -283,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; 
@@ -291,8 +286,7 @@
 		long(pos)=long(pos)-360;
 		delHGLA=InterpFromMeshToMesh2d(index,longGLA,latGLA,delHGLA,long,lat);
-		delHGLAe=delHGLA(md.mesh.elements)*[1;1;1]/3;
 
 		pos=find(delHGIS);
-		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGIS(pos)/100;
+		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;
@@ -376,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.
 
@@ -426,4 +420,5 @@
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
 md.solidearth.requested_outputs= {'default',...
 	'DeltaIceThickness','Sealevel','SealevelUGrd',...
@@ -436,4 +431,5 @@
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
 md=solve(md,'Transient');
 Sselfattraction=md.results.TransientSolution.Sealevel;
@@ -443,4 +439,5 @@
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
 md=solve(md,'Transient');
 Selastic=md.results.TransientSolution.Sealevel;
@@ -450,4 +447,5 @@
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
+md.solidearth.settings.viscous=0;
 md=solve(md,'Transient');
 Srotation=md.results.TransientSolution.Sealevel;
Index: /issm/trunk-jpl/test/NightlyRun/test2004.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2004.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2004.py	(revision 26358)
@@ -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-jpl/test/NightlyRun/test2005.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2005.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2005.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 100: 
Index: /issm/trunk-jpl/test/NightlyRun/test2005.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2005.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2005.py	(revision 26358)
@@ -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,32 +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.isslc = 1
+# Physics
 md.transient.issmb = 0
-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))
@@ -110,5 +122,5 @@
 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-jpl/test/NightlyRun/test2006.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2006.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2006.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 100: 
Index: /issm/trunk-jpl/test/NightlyRun/test2006.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2006.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2006.py	(revision 26358)
@@ -7,4 +7,5 @@
 from lovenumbers import *
 from materials import *
+from MatlabFuncs import *
 from model import *
 from nodalvalue import *
@@ -19,20 +20,28 @@
 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,31 +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.isslc = 1
+md.solidearth.settings.viscous = 0
+
+# Physics
 md.transient.issmb = 0
-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
@@ -109,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
Index: /issm/trunk-jpl/test/NightlyRun/test2007.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2007.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2007.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary
@@ -50,5 +49,5 @@
 md.solidearth.settings.horiz=1;
 
-%Physics: 
+%Physics: bary
 md.transient.issmb=0; 
 md.transient.isstressbalance=0;
Index: /issm/trunk-jpl/test/NightlyRun/test2008.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2008.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2008.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 100: 
Index: /issm/trunk-jpl/test/NightlyRun/test2010.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2010.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2010.m	(revision 26358)
@@ -3,8 +3,7 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
-%Geometry for the bed, arbitrary thickness of 1000: 
+%Geometry for the bed, arbitrary thickness of 100:
 md.geometry.bed=-ones(md.mesh.numberofvertices,1);
 md.geometry.base=md.geometry.bed;
@@ -12,10 +11,8 @@
 md.geometry.surface=md.geometry.bed+md.geometry.thickness;
 
-
 %parameterize slc solution:
 %solidearth loading:  {{{
 md.masstransport.spcthickness=[md.geometry.thickness;0];
 md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
-
 
 xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
@@ -46,5 +43,5 @@
 md.mask.ocean_levelset=oceanmask;
 
-% 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;
 
@@ -71,5 +68,5 @@
 md.solidearth.settings.grdmodel=1;
 md.solidearth.settings.horiz=1;
-md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar' 'SealevelBarystaticIceLongbar'};
+md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar','SealevelBarystaticIceLongbar'};
 
 %Physics: 
@@ -79,5 +76,5 @@
 md.transient.ismasstransport=1;
 md.transient.isslc=1;
- 
+
 md.timestepping.start_time=0;
 md.timestepping.time_step=1;
@@ -117,10 +114,10 @@
 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/moizz]
+theoretical_value_check=[moixz/moi_xz moiyz/moi_yz moizz/moi_zz]
 % }}}
 
 %Fields and tolerances to track changes
 field_names     ={'eus','slc','moixz','moiyz','moizz'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={eus,slc,moixz,moiyz,moizz};
 
Index: /issm/trunk-jpl/test/NightlyRun/test2010.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2010.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2010.py	(revision 26358)
@@ -1,5 +1,3 @@
 #Test Name: MomentOfIntertia
-from socket import gethostname
-
 import numpy as np
 
@@ -7,4 +5,5 @@
 from gmtmask import *
 from lovenumbers import *
+from MatlabFuncs import *
 from model import *
 from paterson import *
@@ -12,28 +11,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,63 +45,94 @@
 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.cluster = generic('name', gethostname(), 'np', 3)
+md.solidearth.settings.viscous = 0
+md.cluster = generic('name', oshostname(), '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.Bslc
-slc = 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))
 # }}}
 
Index: /issm/trunk-jpl/test/NightlyRun/test2011.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2011.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2011.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 1000: 
Index: /issm/trunk-jpl/test/NightlyRun/test2021.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2021.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2021.m	(revision 26358)
@@ -1,15 +1,15 @@
-%Test Name: SESAWslc 
-% SESAW method of solving GRD slc 
-% 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 SESAWslc 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-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 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-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: 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-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.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-slc 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-jpl/test/NightlyRun/test2084.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2084.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2084.m	(revision 26358)
@@ -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; 
 
@@ -26,5 +26,5 @@
 md.materials.lame_lambda=md.materials.lame_mu*0+5e17;
 md.materials.issolid=[1 0 1 1 1 1]';
-md.materials.rheologymodel=0*ones(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;
@@ -44,5 +44,4 @@
 md.love.integration_steps_per_layer=200;
 
-
 md.love.istemporal=1;
 md.love.n_temporal_iterations=8;
@@ -51,5 +50,5 @@
 md.love.love_kernels=1;
 if md.love.istemporal
-md.love=md.love.build_frequencies_from_time;
+	md.love=md.love.build_frequencies_from_time;
 end
 
@@ -64,6 +63,4 @@
 %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
@@ -76,5 +73,4 @@
 	(md.results.LoveSolution.LoveLr(:,1)),...
 	};
-
 
 % validate elastic loading solutions against the Spada benchmark. {{{ 
Index: /issm/trunk-jpl/test/NightlyRun/test2084.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2084.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2084.py	(revision 26358)
@@ -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 MatlabFuncs import *
+from model import *
+from solve import *
 
 md = model()
-md.cluster = generic('name', gethostname(), 'np', 1)
+md.cluster = generic('name', oshostname(), '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-jpl/test/NightlyRun/test2090.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2090.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2090.m	(revision 26358)
@@ -3,6 +3,5 @@
 %mesh earth:
 md=model;
-load ../Data/SlcTestMesh.mat;
-md.mesh=SlcMesh; %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
 %Geometry for the bed, arbitrary thickness of 1000: 
Index: /issm/trunk-jpl/test/NightlyRun/test2101.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2101.m	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2101.m	(revision 26358)
@@ -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-jpl/test/NightlyRun/test2101.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test2101.py	(revision 26357)
+++ /issm/trunk-jpl/test/NightlyRun/test2101.py	(revision 26358)
@@ -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-jpl/test/Par/SquareSheetConstrained.py
===================================================================
--- /issm/trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26357)
+++ /issm/trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26358)
@@ -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,5 @@
 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
@@ -35,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
@@ -44,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
@@ -58,6 +58,6 @@
 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'
 
